Dialogue interaction method and apparatus, device, and storage medium

ABSTRACT

Embodiments of the present disclosure relate to a dialogue interaction method and apparatus, a device and a storage medium, and relate to the field of artificial intelligence technology. The method may include: determining a first semantic encoding of received user information according to a sentence tree; determining a second semantic encoding for responding to the user information from a dialogue tree according to the first semantic encoding, the sentence tree and the dialogue tree being trained and obtained through sentence node information and/or word node information in a logical brain map sample; and determining a target response sentence of the second semantic encoding from the sentence tree, to be used for a dialogue with a user.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Application No.202010017420.6, filed on Jan. 8, 2020 and entitled “Dialogue InteractionMethod and Apparatus, Device, and Storage Medium,” the entire disclosureof which is hereby incorporated by reference.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the field of computertechnology, particularly to the field of artificial intelligencetechnology, and specifically to a dialogue interaction method andapparatus, a device and a storage medium.

BACKGROUND

With the popularization of smart devices such as a smart sound boxdevice, demands for dialogues between users and the smart devices areincreasing day by day. In addition to needs for resource on-demand, homecontrol, etc., most users have needs for human-machine interactionbehaviors with the smart devices, for example, an emotionalcommunication, a daily dialogue, and a topic chat. However, the existingtechnology generally can only achieve the effects of a single-rounddialogue, and is lack of the logicality of the context of the dialogue,resulting in a low accuracy of a multi-round dialogue and a high cost oftraining corpus.

SUMMARY

Embodiments of the present disclosure provide a dialogue interactionmethod and apparatus, a device and a storage medium, to improve theaccuracy of a multi-round dialogue between a user and a machine.

In a first aspect, an embodiment of the present disclosure provides adialogue interaction method, the method includes: determining a firstsemantic encoding of received user information according to a sentencetree; determining a second semantic encoding for responding to the userinformation from a dialogue tree according to the first semanticencoding, the sentence tree and the dialogue tree being trained andobtained through sentence node information and/or word node informationin a logical brain map sample; and determining a target responsesentence of the second semantic encoding from the sentence tree, to beused for a dialogue with a user.

An embodiment of the present disclosure has the following advantages orbeneficial effects: a dialogue logic is quickly learned into a sentencetree and a dialogue tree based on a logical brain map, and responsecontent takes into account the dialogue content of a preceding part of adialogue through alternating matching between the sentence tree and thedialogue tree, and contains various representations of the dialoguecontent, and thus, the diversity of the dialogue content is ensured, andthe accuracy of a multi-round dialogue between a user and a machine isimproved.

Alternatively, the sentence tree is used to represent a combinationrelationship between a word and a sentence, and the dialogue tree isused to represent a response relationship between sentences in thedialogue.

An embodiment of the present disclosure has the following advantages orbeneficial effects: through a sentence tree having a combinationrelationship and a dialogue tree having a response relationship,response content takes into account the dialogue content of a precedingpart of a dialogue, and contains various representations of the dialoguecontent, and thus, various possibilities of the dialogue content areensured.

Alternatively, the sentence tree and the dialogue tree are determinedby: learning and obtaining anode in the sentence tree and a node in thedialogue tree according to the logical brain map sample; anddetermining, in the sentence tree and the dialogue tree, a conversionprobability between nodes.

An embodiment of the present disclosure has the following advantages orbeneficial effects: node information and a conversion probabilitybetween nodes that are determined according to a logical brain mapsample together constitute a sentence tree and a dialogue tree, suchthat the nodes in the trees have a dialogue logic, and variousrepresentations of dialogue content are contained, and thus, variouspossibilities of the dialogue content are ensured.

Alternatively, learning and obtaining the node in the sentence treeaccording to the logical brain map sample includes: performing a wordnode depth search on the logical brain map sample to obtain a completedialogue path; constituting a dialogue dictionary according to wordnodes in the complete dialogue path; performing sentence semanticcompression on a sentence composed of words in the dialogue dictionaryto generate a sentence node in the sentence tree, and obtaining acombination of word nodes in the sentence node according to the dialoguedictionary; and adding a semantic encoding identifying sentencesemantics to the sentence node according to semantics of the combinationof the word nodes in the sentence node.

An embodiment of the present disclosure has the following advantages orbeneficial effects: a word in a dialogue dictionary constructed based ona logical brain map sample constitutes a word node in a sentence tree,semantics expressed by a combination of word nodes constitutes asentence node, and based on different approaches to combine the wordnodes, the sentence node may contain different sentence semantics, andthus, each kind of sentence semantics is configured with a correspondingsemantic encoding, which is conductive to identifying user informationof different representations and conductive to a plurality ofrepresentations of the same semantics, thereby ensuring the diversity ofdialogues.

Alternatively, learning and obtaining the node in the dialogue treeaccording to the logical brain map sample includes: performing semanticcompression on sentence nodes in the logical brain map sample togenerate a sentence node in the dialogue tree; determining a responserelationship between sentence nodes in the dialogue tree based on adialogue logic represented by a connection relationship between sentencenodes in the logical brain map; and obtaining the dialogue treeaccording to the sentence nodes and the response relationship betweenthe sentence nodes, and adding a semantic encoding identifying sentencesemantics to the sentence nodes according to semantics of the sentencenodes.

An embodiment of the present disclosure has the following advantages orbeneficial effects: sentence semantics compressed based on a logicalbrain map sample constitutes a sentence node in a dialogue tree, asemantic encoding is added to each sentence node, a responserelationship between sentence nodes in the dialogue tree is determinedbased on the dialogue logic in a logical brain map, and thecorresponding relationship of the semantics is conductive to determiningthe dialogue logic between utterances in a dialogue, and is not limitedto the representation of a word in a sentence.

Alternatively, the determining a first semantic encoding of receiveduser information according to a sentence tree includes: traversing froma word node to a sentence node in the sentence tree according to wordinformation of the user information, and determining a combination oftarget word nodes constituting the user information; and determining,from a sentence node to which the combination of the target word nodesbelongs, the first semantic encoding for representing the userinformation, according to the combination of the target word nodes.

An embodiment of the present disclosure has the following advantages orbeneficial effects: by matching word information in user information anda sentence node in a sentence tree, a combination of target word nodesconforming to the word information is determined, such that firstsemantic encoding of the sentence node to which the combination of thetarget word nodes belongs is determined, thereby implementing thesemantic identification for the user information.

Alternatively, the determining a second semantic encoding for respondingto the user information from a dialogue tree according to the firstsemantic encoding includes:

positioning and obtaining, from the dialogue tree, a target usersentence node consistent with the first semantic encoding; extractingand obtaining, according to a conversion probability of a candidatesentence node having a response relationship with the target usersentence node, a response sentence node from the candidate sentencenode; and determining the second semantic encoding of the responsesentence node.

An embodiment of the present disclosure has the following advantages orbeneficial effects: based on first semantic encoding, a sentence node ispositioned in a dialogue tree, such that second semantic encodingresponding to the user information is determined according to a responserelationship between sentence nodes, and thus, it is implemented thatthe response semantics is determined on the basis of a dialogue logic,and the limitation of a word representation on a dialogue and theneglect of a preceding part of the dialogue are avoided, therebyensuring the diversity and accuracy of dialogues.

Alternatively, the determining a target response sentence of the secondsemantic encoding from the sentence tree includes: finding a targetresponse sentence node consistent with the second semantic encoding fromthe sentence tree; extracting, according to conversion probabilities ofcandidate word nodes having a combination relationship with the targetresponse sentence node, target response word nodes from the candidateword nodes; and combining the target response word nodes to obtain thetarget response sentence.

An embodiment of the present disclosure has the following advantages orbeneficial effects: a target response sentence node is determined from asentence tree according to second semantic encoding as responsesemantics, a combination of words expressing the second semantics isdetermined according to the second semantic encoding, and finally, atarget response sentence is formed to be used for a dialogue, and thus,in the situation where the semantics is correctly expressed, thediversity of dialogues is ensured.

In a second aspect, an embodiment of the present disclosure provides adialogue interaction apparatus, the apparatus includes: a user semanticsidentifying module, configured to determine a first semantic encoding ofreceived user information according to a sentence tree; a responsesemantics determining module, configured to determine a second semanticencoding for responding to the user information from a dialogue treeaccording to the first semantic encoding, the sentence tree and thedialogue tree being trained and obtained through sentence nodeinformation and/or word node information in a logical brain map sample;and a response sentence determining module, configured to determine atarget response sentence of the second semantic encoding from thesentence tree, to be used for a dialogue with a user.

In a third aspect, an embodiment of the present disclosure provides anelectronic device, the electronic device includes: at least oneprocessor; and a storage device, communicatively connected with the atleast one processor, where the storage device stores an instructionexecutable by the at least one processor, and the instruction isexecuted by the at least one processor, to cause the at least oneprocessor to perform the dialogue interaction method according toembodiments of the present disclosure.

In a fourth aspect, an embodiment of the present disclosure provides anon-transitory computer readable storage medium, storing a computerinstruction, where the computer instruction is used to cause a computerto perform the dialogue interaction method according to embodiments ofthe present disclosure.

An embodiment of the present disclosure has the following advantages orbeneficial effects: a sentence tree and a dialogue tree are pre-trained,learned and obtained through sentence node information and/or word nodeinformation in a logical brain map sample, when user information of auser dialogue is received, first semantic encoding of the userinformation is determined according to the sentence tree, secondsemantic encoding for responding to the user information is determinedfrom the dialogue tree according to the first semantic encoding, andfinally, a target response sentence is determined from the sentence treeaccording to the second semantic encoding, to be used for a dialoguewith a user. In embodiments of the present disclosure, the dialoguelogic is quickly learned into the sentence tree and the dialogue treebased on the logical brain map, and the response content takes intoaccount the dialogue content of a preceding part of the dialogue throughalternating matching between the sentence tree and the dialogue tree,and contains various representations of the dialogue content, and thus,the diversity of the dialogue content is ensured, and the accuracy of amulti-round dialogue between a user and a machine is improved.

Other effects of the above alternative implementations will be describedhereinafter in combination with specific embodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

Accompanying drawings are used for a better understanding of the scheme,and do not constitute a limitation to the present disclosure.

FIG. 1 is a flowchart of a dialogue interaction method according to afirst embodiment of the present disclosure;

FIG. 2 is a flowchart of training a sentence tree and a dialogue treeaccording to a second embodiment of the present disclosure;

FIG. 3 is a flowchart of training a node in the sentence tree accordingto the second embodiment of the present disclosure;

FIG. 4 is an example diagram of a logical brain map sample according tothe second embodiment of the present disclosure;

FIG. 5 is a flowchart of training a node in the dialogue tree accordingto the second embodiment of the present disclosure;

FIG. 6 is a flowchart of a dialogue interaction method according to athird embodiment of the present disclosure;

FIG. 7 is a schematic structural diagram of a dialogue interactionapparatus according to a fourth embodiment of the present disclosure;and

FIG. 8 is a block diagram of an electronic device adapted to implement adialogue interaction method according to embodiments of the presentdisclosure.

DETAILED DESCRIPTION OF EMBODIMENTS

Example embodiments of the present disclosure are described below incombination with the accompanying drawings, and various details ofembodiments of the present disclosure are included in the description tofacilitate understanding, and should be considered as illustrative only.Accordingly, it should be recognized by one of the ordinary skilled inthe art that various changes and modifications may be made toembodiments described herein without departing from the scope and spiritof the present disclosure. Also, for clarity and conciseness,descriptions for well-known functions and structures are omitted in thefollowing description.

First Embodiment

FIG. 1 is a flowchart of a dialogue interaction method according to thefirst embodiment of the present disclosure. This embodiment may beapplicable to a situation where a response sentence is determined in amulti-round dialogue between a user and a machine. The method may beperformed by a dialogue interaction apparatus, and the apparatus isimplemented by means of software and/or hardware, and alternativelyconfigured in an electronic device, for example, a smart sound box. Asshown in FIG. 1, the method specifically includes the following steps.

S110, determining a first semantic encoding of received user informationaccording to a sentence tree.

In a specific embodiment of the present disclosure, the user informationrefers to dialogue voice inputted by a user to an electronic device. Thedialogue voice may refer to initial voice in a dialogue initiatedactively by the user to the electronic device after the user wakes upthe electronic device, any dialogue voice inputted by the user during adialogue, or dialogue voice inputted by the user when the electronicdevice actively initiates a dialogue. The user information may not belimited to the same dialogue scenario, but may be switched betweendifferent dialogue scenarios. The electronic device may cooperate withthe user to implement the dialogue.

In this embodiment, the first semantic encoding refers to an encodingexpressing semantics of the user information. In view of that a word ora sentence has at least one kind of semantics, in this embodiment, onekind of semantics is uniquely identified by using a semantic encoding,so as to present a dialogue logic through fundamental semantics, whichavoids that the dialogue is limited to the word representation in anexternal form.

In this embodiment, a data structure for a dialogue interaction in theelectronic device may include at least a sentence tree and a dialoguetree. Here, the sentence tree is used to represent a combinationrelationship between a word and a sentence, and the dialogue tree isused to represent a response relationship between sentences in adialogue. Both the sentence tree and the dialogue tree are trained andobtained through sentence node information and/or word node informationin a logical brain map sample.

Specifically, a logical brain map refers to that the words and/orsentences involved in a dialogue are presented through a subordinaterelationship and a hierarchical relationship between related nodes. Thelogical brain map may include the combination relationship between theword and the sentence, and the dialogue tree is used to represent theresponse relationship between the sentences in the dialogue. In thisembodiment, logical brain maps may be pre-constructed for differentscenarios to be used to represent dialogue logics in the differentscenarios. The logical brain maps in the different scenarios are used asa large number of basic samples, and a large number of sentences andword representations of the sentences are mined. The words in thelogical brain map samples are reserved, but semantic compression isperformed on the sentences in the logical brain map samples. A semanticencoding is added to a sentence node and a word node based on semantics,that is, each kind of semantics is configured with a uniquelycorresponding semantic encoding. Correspondingly, a node containing manykinds of semantics is configured with a plurality of semantic encodings,to be used for uniquely identifying one kind of semantics. Finally, aconversion probability between nodes is determined, and the sentencetree and the dialogue tree are formed to be stored in the electronicdevice for use by the electronic device in the dialogue with the user.Here, the process of training the sentence tree and the dialogue treewill be explained in a subsequent embodiment.

In this embodiment, after the user information is received, the userinformation in an external form is converted into fundamental semanticsbased on a combination relationship between a word and sentencesemantics in the sentence tree. Accordingly, it is first implementedthat the received user information is not limited to the externalrepresentation form. Specifically, the semantics expressed by theexternal form of the user information may be determined according to thecombination relationship between the word and the sentence in thesentence tree, such that the semantic understanding for the userinformation is realized, thus obtaining the first semantic encodingexpressing the semantics of the user information.

For example, the electronic device maybe a smart device having adialogue function such as a smart sound box and a service robot. Afterreceiving the user information in the form of voice inputted by the userthrough an apparatus such as a sensor, the electronic device may convertthe user information in the form of voice into a form of text, andperform word splitting on the user information in the form of text.According to the arrangement order of the words in the user information,a combination of target word nodes constituting the user information isdetermined by traversing from a word node to a sentence node in thesentence tree, based on a connection relationship between word nodes inthe sentence tree. Therefore, the first semantic encoding forrepresenting the user information is determined from a sentence node towhich the combination of the target word nodes belongs.

S120, determining a second semantic encoding for responding to the userinformation from a dialogue tree according to the first semanticencoding.

In a specific embodiment of the present disclosure, the first semanticencoding refers to the encoding expressing the semantics of the userinformation, and correspondingly, the second semantic encoding refers toa semantic encoding for responding to the user information. Here, thedefinitions of “first” and “second” have no specific meaning, but onlydistinguish the semantics of the user information from the semanticscorresponding to the response of the user information.

In this embodiment, after the semantics of the user information isdetermined, the semantics of response information is determined from thesemantics of the user information based on the response relationshipbetween the sentences in the dialogue in the dialogue tree. Thus, it isfurther implemented that the response is not limited to the externalrepresentation form and the semantics is used as the basis for matching.Specifically, a target user sentence node consistent with the firstsemantic encoding may be positioned and obtained from the dialogue tree,that is, the degree of dialogue reached by the current user informationmay be positioned. A response sentence node for continuing from orresponding to the target user sentence node is determined according tothe response relationship between the sentences in the dialogue tree, toobtain the second semantic encoding expressing the semantics of theresponse sentence node.

Here, since the second semantic encoding is determined based on theoverall dialogue logic of the dialogue tree, the determination for thesecond semantic encoding takes into account a preceding part of thedialogue, rather than simply replies to the user information in thisinteraction, such that the entire dialogue is linked, thus implementingthe accurate determination for the semantics of the response.

For example, the dialogue tree contains complete content of dialoguesand a logical relationship. It is assumed that a certain dialogue iscomposed of 7 layers of dialogue semantics, the 7 layers of dialoguesemantics having a response relationship therebetween. It is assumedthat the degree of dialogue reached by the current user information andpositioned from the dialogue tree according to the first semanticencoding reaches the dialogue semantics of the third layer. Thus,according to the response relationship between sentence nodes in thedialogue tree, the semantic encoding of the dialogue semantics of thefourth layer in the dialogue is determined as the second semanticencoding.

Here, there may be a plurality of kinds of candidate dialogue semanticsfor responding to the user information in the dialogue tree. That is,the target user sentence node may include a plurality of child nodeswhen the target user sentence node is a parent node. In addition, basedon statistics on the logical brain map sample, the conversionprobabilities that the parent node is converted to the child nodes aredifferent. Thus, the candidate semantics with a highest conversionprobability may be selected as the second semantic encoding. In order toensure the diversity of dialogues and avoid that the dialogues arelimited to one kind of situation, in this embodiment, a randomextraction may be performed according to the conversion probabilities ofthe candidate dialogue semantics, to obtain the second semanticencoding.

S130, determining a target response sentence of the second semanticencoding from the sentence tree, to be used for a dialogue with a user.

In a specific embodiment of the present disclosure, the target responsesentence refers to a sentence that can express the semantics of thesecond semantic encoding and has a specific external word representationform. The target response sentence may be present in a form of text. Thetarget response sentence is played to the user by the electronic deviceto respond to the user information of the user, thus implementing thedialogue with the user.

In this embodiment, in view of that the same semantics may have aplurality of external word representation forms, after the secondsemantic encoding is determined, the fundamental semantics maybeconverted into the target response sentence in the external form basedon the combination relationship between the word and sentence semanticsin the sentence tree. Thus, it is implemented that the output of thetarget response sentence is not limited to the same external wordrepresentation form. Specifically, a target response sentence nodeconsistent with the second semantic encoding is found from the sentencetree. Target response word nodes for composing the target responsesentence are determined according to word nodes having a combinationrelationship with the target response sentence node. Finally, the targetresponse word nodes are combined to obtain the target response sentence.

Here, the sentence tree may include a plurality of synonyms. That is,the target response sentence node or a certain target response word nodemay include a plurality of child nodes, when the target responsesentence node or the target response word node is a parent node. Inaddition, based on the statistics on the logical brain map sample, theconversion probabilities that the parent node is converted to the childnodes are different. Thus, the candidate word node with a highestconversion probability may be selected as the target response word noderequired for the connection of the sentence. In order to ensure thediversity of the dialogues and avoid that the dialogues are limited toone kind of representation, in this embodiment, a random extraction maybe performed according to the conversion probabilities of candidate wordnodes, to obtain a target response word node of each level.

According to the technical solution of this embodiment, the sentencetree and the dialogue tree are pre-trained, learned and obtained throughthe sentence node information and/or the word node information in thelogical brain map sample. When the user information of the user dialogueis received, the first semantic encoding of the user information isdetermined according to the sentence tree. The second semantic encodingfor responding to the user information is determined from the dialoguetree according to the first semantic encoding. Finally, the targetresponse sentence is determined from the sentence tree according to thesecond semantic encoding, to be used for the dialogue with the user. Inthis embodiment of the present disclosure, the dialogue logic is quicklylearned into the sentence tree and the dialogue tree based on thelogical brain map, and the response content takes into account thedialogue content of the preceding part of the dialogue throughalternating matching between the sentence tree and the dialogue tree,and contains various representations of the dialogue content, and thus,the diversity of the dialogue content is ensured, and the accuracy ofthe multi-round dialogue between the user and the machine is improved.

Second Embodiment

FIG. 2 is a flowchart of training a sentence tree and a dialogue treeaccording to a second embodiment of the present disclosure. On the basisof the first embodiment described above, the approach to training thesentence tree and the dialogue tree is further explained in thisembodiment, and the sentence tree and the dialogue tree can be trainedand obtained based on the sentence node information and/or the word nodeinformation in the logical brain map sample. As shown in FIG. 2, themethod specifically includes the following steps.

S210, learning and obtaining a node in a sentence tree and a node in adialogue tree according to a logical brain map sample.

In a specific embodiment of the present disclosure, a logical brain maprefers to that the words and/or sentences involved in a dialogue arepresented through a subordinate relationship and a hierarchicalrelationship between related nodes. Logical brain maps may bepre-constructed for different scenarios to be used to represent dialoguelogics in the different scenarios. The logical brain maps in thedifferent scenarios are used as a large number of samples.

This embodiment is not limited to the external word representation formand semantics present in the logical brain map sample. A completedialogue path is obtained by performing a depth-first-search (DFS) onnodes in the logical brain map sample. In view of that a part of thecomplete dialogue path may also constitute a dialogue, the completedialogue path is split, to mine a large number of word representationsof the sentence and the semantics expressed by the sentence.

In this embodiment, the words in the logical brain map sample arereserved, but semantic compression is performed on the sentences in thelogical brain map sample. A semantic encoding is added to a sentencenode and a word node based on semantics, that is, each kind of semanticsis configured with a uniquely corresponding semantic encoding.Correspondingly, a node containing many kinds of semantics is configuredwith a plurality of semantic encodings. Each semantic encoding is usedfor uniquely identifying one kind of semantics. The node in the sentencetree and the node in the dialogue tree are formed.

Specifically, FIG. 3 is a flowchart of training the node in the sentencetree. As shown in FIG. 3, learning and obtaining the node in thesentence tree according to the logical brain map sample includes thefollowing steps.

S2111, performing a word node depth search on the logical brain mapsample to obtain a complete dialogue path.

In this embodiment, the depth search starts from a parent node in thelogical brain map sample, and continues as deep as possible along eachbranch until the search cannot be further performed, and thus, thecomplete dialogue path is obtained.

Here, for the sentence nodes in a traversed path, the dialogue logicbetween the sentence nodes may be learned and obtained. For the wordnodes in the traversed path, a complete representation of a sentence maybe obtained.

S2112, constituting a dialogue dictionary according to word nodes in thecomplete dialogue path.

In this embodiment, since a part of a complete sentence path may alsoconstitute a dialogue, and a part of a complete word path may also becombined into a sentence, the splitting is performed on the completedialogue path, to mine the large number of word representations of thesentence and the semantics expressed by the sentence. Here, in theprocess of training the sentence tree, all the word nodes in the logicalbrain map sample, all the word nodes during the mining, and theconnection relationships between the word nodes are reserved, toconstitute the dialogue dictionary.

S2113, performing sentence semantic compression on a sentence composedof words in the dialogue dictionary to generate a sentence node in thesentence tree, and obtaining a combination of word nodes in the sentencenode according to the dialogue dictionary.

In this embodiment, the words in the dialogue dictionary are combinedaccording to the word nodes in the dialogue dictionary and theconnection relationship thereof, to obtain the semantics of the sentencecomposed of the words. Semantic compression is performed on thesemantics of the sentence composed of the words, based on theminimization of data storage in an electronic device and thecompleteness and uniqueness of the sentence tree. That is, the sentenceshaving the same semantics are merged to generate the sentence node inthe sentence tree. However, all the words in the sentences are reserved,i.e. the combination of the word nodes in the sentence node is obtained.It may be understood that the sentence tree reserves a plurality of wordrepresentation forms of the sentence.

For example, if sentence semantics is expressed as that Lao Zhangcriticizes Xiao Wang, the following three representation forms may beincluded: “Lao Zhang criticizes Xiao Wang,” “Lao Zhang makes a criticismagainst Xiao Wang,” and “Xiao Wang is criticized by Lao Zhang.” Then,the three representation forms may be compressed into the same sentencenode based on the same semantics, and the sentence node includes threecombinations of word nodes.

S2114, adding a semantic encoding identifying sentence semantics to thesentence node, according to semantics of the combination of the wordnodes in the sentence node.

In this embodiment, one kind of semantics is uniquely identified byusing a semantic encoding, so as to present a dialogue logic throughfundamental semantics, which avoids that the dialogue is limited to theword representation in an external form. Here, since, in the sentencenode, additional semantics may be expressed based on a sentence composedof different word nodes on the same path, additional sentence semanticsare correspondingly given to the sentence node. Therefore, one semanticencoding is added to each kind of semantics according to the semanticsof the combination of the word nodes in the sentence node.Correspondingly, the same sentence node in the sentence tree may have aplurality of semantic encodings.

Here, a word node in the sentence tree may also have a semanticencoding. Correspondingly, the semantic encoding of the sentence node isgenerated according to the semantic encodings of the word nodes includedin the combination of the word nodes. That is, the sentence node and thecombination of the word nodes present a certain association relationshipin semantic encoding. For example, the semantic encoding of the sentencenode may be a connection of the semantic encodings of the word nodes inthe combination of the word nodes, or may be an encoding generatedthrough a certain algorithm using the semantic encodings of the wordnodes.

For example, FIG. 4 is an example diagram of the logical brain mapsample. As shown in FIG. 4, it is assumed that the sample includes 9layers of nodes C1-C9, the layers C1-C6 may be sentence nodes, and thelayers C7-C9 may be word nodes. The complete path [C1, C2, . . . , C9]may be obtained by performing a depth-first-search on the sample, toobtain a dialogue. Splitting is performed on the complete path. Takingthe left-most branch as an example, [C1, C2, C3] may also constitute adialogue to mine a large number of word representations of the sentenceand the semantics expressed by the sentence. The layers C7-C9 constitutewords in a dialogue. Here, by performing sentence semantics compressionon the sample, a plurality of nodes in the layer C7 may be merged intothe sentence node C6 having the same semantics, to generate the sentencenode in the sentence tree. For the sentence node C6, a plurality ofcombinations of word nodes in [C7, C8, C9] may be obtained. According tothe semantics of a combination of a part of word nodes in the sentencenode, it is assumed that “duly come” and “duly arrive” may form thesemantics different from that of the complete path of C7-C9, and thus,at least two semantic encodings may be added to the sentence node C6.

It should be noted that, based on the complexity of the logical brainmap, FIG. 4 is only a simple illustration for the logical brain map, andmay be not completely accurate, and the logical brain map is not limitedto the specific representation of the example.

Specifically, FIG. 5 is a flowchart of training the node in the dialoguetree. As shown in FIG. 5, learning and obtaining the node in thedialogue tree according to the logical brain map sample includes thefollowing steps.

S2121, performing semantic compression on sentence nodes in the logicalbrain map sample to generate a sentence node in the dialogue tree.

In this embodiment, in the process of generating the dialogue tree, thesentence nodes in the logical brain map sample are basically reserved,and the semantic compression is only performed on the sentence nodes inthe logical brain map, i.e., sentences having the same semantics aremerged, to generate the sentence node in the dialogue tree. For example,the sentences in the three sentence nodes present in the logical brainmap sample are “Lao Zhang criticizes Xiao Wang,” “Lao Zhang makes acriticism against Xiao Wang,” and “Xiao Wang is criticized by LaoZhang.” Since the sentence semantics of the three sentence nodes are thesame, the sentence semantics of the three sentence nodes is generated toform the same sentence node in the dialogue tree.

S2122, determining a response relationship between sentence nodes in thedialogue tree based on a dialogue logic represented by a connectionrelationship between sentence nodes in the logical brain map.

In this embodiment, in compliance with the connection relationshipbetween the sentence nodes in the logical brain map, the responserelationship is established for the sentence nodes in the dialogue tree.Correspondingly, since the dialogue tree is trained and obtained basedon a large number of logical brain map samples, the dialogue tree mayinclude a plurality of candidate sentence nodes having a responserelationship with the same sentence node.

S2123, obtaining the dialogue tree according to the sentence nodes andthe response relationship between the sentence nodes, and adding asemantic encoding identifying sentence semantics to the sentence nodesaccording to semantics of the sentence nodes.

In this embodiment, the sentence nodes and the response relationshiptherebetween together constitute the dialogue tree. A sentence node inthe dialogue tree generally has only one kind of semantics, andcorrespondingly, each sentence node in the dialogue tree has a uniquelycorresponding semantic encoding. Here, the semantic encoding of thesentence node in the dialogue tree corresponds to the semantic encodingof the sentence node in the sentence tree, that is, there is acorresponding relationship, and the sentence node in the dialogue treeand the sentence node in the sentence tree have the same semanticencoding, so as to position the degree of dialogue of the userinformation from the sentence tree to the dialogue tree, and find aresponse sentence from the dialogue tree to the sentence tree.

S220, determining, in the sentence tree and the dialogue tree, aconversion probability between nodes.

In a specific embodiment of the present disclosure, the conversionprobability refers to the probability that a previous node is convertedand connected to a next node between nodes having a connectionrelationship. In this embodiment, each node may be configured with alist of conversion probabilities for representing conversionprobabilities that different nodes are connected to this node.

In the sentence tree, based on the logical brain map sample, theprobability of using a first word expressing sentence node semantics maybe statisticized, and the probability of using a word node to connectanother word node may be statisticized. For example, for the sentencenode semantics “I duly come home,” “I” may be followed by “duly” and“punctually.” Here, the probability of using “duly” is 60%, and theprobability of using “punctually” is 40%. Therefore, on the basis of thesemantics “I duly come home,” the probability that the word node “I” isconverted to the word node “duly” is 60%, and the probability that theword node “I” is converted to the word node “punctually” is 40%.

In the dialogue tree, the probabilities of using different sentencenodes responding to the same semantics may be statisticized based on thelogical brain map sample. For example, for the sentence node semantics“I miss you,” the probability of “I miss you, too” responding to thesentence node semantics is 70%, and the probability of “memeda”responding to the sentence node semantics is 30%.

Here, for user information of a question type in the dialogue, theelectronic device may determine a reply answer through a network searchand directly use the reply answer as a response to implement thedialogue, or may determine the semantics of the reply answer through thetraversal for the word nodes in the sentence tree and re-determine, inthe sentence tree, a combination of word nodes of the reply answer.

According to the technical solution of this embodiment, the node in thesentence tree and the node in the dialogue tree are pre-trained, learnedand obtained through the sentence node information and/or the word nodeinformation in the logical brain map sample. The conversion probabilitybetween the nodes is statisticized according to the logical brain sampleto form the sentence tree and the dialogue tree. In this embodiment ofthe present disclosure, the dialogue logic is quickly learned into thesentence tree and the dialogue tree based on the logical brain map, andvarious representations of the dialogue content are contained, and thus,the diversity of the dialogue content is ensured, and the accuracy ofthe multi-round dialogue between the user and the machine is improved.

Third Embodiment

FIG. 6 is a flowchart of a dialogue interaction method according to athird embodiment of the present disclosure. On the basis of the firstembodiment described above, in this embodiment, the approach todetermining the target response sentence is further explained, thesemantics of the user information can be identified through thetraversal for the word nodes in the sentence tree, the responsesemantics is determined through the response relationship between thesentence nodes in the dialogue tree, and finally, the target responsesentence is determined through the extraction for word nodes in thesentence tree under the response semantics. As shown in FIG. 6, themethod specifically includes the following steps.

S610, traversing from a word node to a sentence node in a sentence treeaccording to word information of user information, and determining acombination of target word nodes constituting the user information.

In a specific embodiment of the present disclosure, the user informationrefers to dialogue voice inputted by a user to an electronic device.Correspondingly, the word information of the user information may beinformation such as words obtained by performing splitting on the userinformation in a form of text that is converted from the userinformation in a form of voice, and an order of the words.

In this embodiment, the combination of the target word nodes refers toword nodes in the sentence tree that match the external form of the wordinformation of the user information, have a connection relationshipbetween the word nodes and is capable of constituting a path. Thefundamental semantics of the user information may be obtained throughthe matching in the form.

Specifically, according to the reverse order of the words in the wordinformation, the words in the word information may be adopted insequence. On the basis of a word node successfully matching a precedingword, a traversal is performed in an order from a child node to a rootnode according to the connection relationship between the word nodes inthe sentence tree. Here, the combination of all the word nodes that aresuccessfully matched and traversed and constitute the path is thecombination of the target word nodes constituting the user information.

For example, it is assumed that the nodes C6-C9 in FIG. 4 refer to asentence tree, and it is assumed that the user information is “duly comehome,” the word information of the user information is obtained asfollows: “duly” -> “come” -> “home.” Then, a traversal is performed inan order from a child node to a root node. First, matching is performedon the word information “home” and the word node C9. Second, matching isperformed on the word information “come” and “come” in the word node C8if the matching between the word information “home” and the word node C9is successful. Finally, matching is performed on the word information“duly” and “duly” in the word node C7 if the matching between the wordinformation “come” and “come” in the word node C8 is successful. If thematching between word information “duly” and “duly” in the word node C7is successful and a path is constituted, “duly” in the word node C7,“come” in the word node C8 and “home” in the word node C9 are used asthe combination of the target word nodes.

S620, determining, from a sentence node to which the combination of thetarget word nodes belongs, a first semantic encoding for representingthe user information, according to the combination of the target wordnodes.

In a specific embodiment of the present disclosure, since the word nodesin the combination of the target word nodes constitute the path, thecombination of the target word nodes belongs to the same sentence node,and therefore, the semantic encoding of the sentence node is used as thefirst semantic encoding of the user information. Here, if the sentencenode includes a plurality of semantic encodings, according to the wordnodes included in the combination of the target word nodes, the semanticencoding of the semantics expressed by the combination of the targetword nodes is determined from the plurality of semantic encodings basedon the generation basis of the semantic encodings of the sentence node,to be used as the first semantic encoding of the user information. Forexample, in the above example, the semantic encoding of the sentencenode C6 is used as the first semantic encoding of the user information.

S630, positioning and obtaining, from a dialogue tree, a target usersentence node consistent with the first semantic encoding.

In a specific embodiment of the present disclosure, the target usersentence node refers to a sentence node, in the dialogue tree, matchingthe semantics of the user information. In view of that the dialogue treerepresents the response relationship between sentences in a dialogue,the target user sentence node positions the current degree of dialogueof the user information.

Specifically, matching is performed on the first semantic encoding andthe semantic encoding of each sentence node in the dialogue tree, toobtain a sentence node matching the first semantic encoding as thetarget user sentence node. Here, if the user information is dialogueinformation during the dialogue, according to a connection relationshipbetween sentence nodes in the dialogue tree, the matching for the targetuser sentence node may be continued among child nodes to which thesentence node matching the preceding part of the dialogue is connected,so as to narrow the matching range. If the matching fails, it mayindicate that the user initiates a dialogue of other topics, and thus,the matching may be performed in all dialogue trees at this time.

S640, extracting and obtaining, according to a conversion probability ofa candidate sentence node having a response relationship with the targetuser sentence node, a response sentence node from the candidate sentencenode.

In a specific embodiment of the present disclosure, the responsesentence node refers to a sentence node, in the dialogue tree, used forresponding to the target user sentence node. There may be a plurality ofcandidate sentence nodes for responding to the target user sentence nodein the dialogue tree. That is, the target user sentence node may includea plurality of child nodes, when the target user sentence node is aparent node. The response sentence node is one of the candidate sentencenodes having the response relationship with the target user sentencenode.

Here, based on statistics on a logical brain map sample, the conversionprobabilities that the parent node is converted to the child nodes aredifferent. Thus, the candidate sentence node with a highest conversionprobability may be selected as the response sentence node. In order toensure the diversity of dialogues and avoid that the dialogues arelimited to one kind of situation, in this embodiment, a randomextraction may be performed on the candidate sentence nodes according tothe conversion probabilities of the candidate sentence nodes, to obtainthe response sentence node.

For example, it is assumed that the target user sentence node includestwo candidate sentence nodes, that is, a smart device possesses tworesponse approaches after the user expresses the dialogue semantics ofthe target user sentence node. Here, if the conversion probability of afirst candidate sentence node is 60% and the conversion probability of asecond candidate sentence node is 40%, in the process of a randomextraction, the probability that the first candidate sentence node maybe extracted is 60%, and the probability that the second candidatesentence node may be extracted is 40%.

S650, determining a second semantic encoding of the response sentencenode.

In a specific embodiment of the present disclosure, since a sentencenode in the dialogue tree generally has only one semantic encoding, thesemantic encoding of the response sentence nodes is used as the secondsemantic encoding.

S660, finding a target response sentence node consistent with the secondsemantic encoding from the sentence tree.

In a specific embodiment of the present disclosure, after the responseof the user information is determined, the specific representation formof the response may be determined. Specifically, the target responsesentence node refers to a sentence node in the sentence tree that iscapable of expressing response semantics. Matching is performed on thesecond semantic encoding and the semantic encoding of each sentence nodein the sentence tree, and the sentence node having the matching semanticencoding is used as the target response sentence node.

S670, extracting, according to conversion probabilities of candidateword nodes having a combination relationship with the target responsesentence node, target response word nodes from the candidate word nodes.

In a specific embodiment of the present disclosure, the target responseword node refers to a word node, in the sentence tree, used forrepresenting the semantics of the target response sentence node. Theremaybe a plurality of candidate word nodes for representing the targetresponse sentence node in the sentence tree. That is, the targetresponse sentence node may include a plurality of child nodes, when thetarget response sentence node is a parent node, and each child node mayinclude a plurality of child nodes. The target response word node is atleast one of the candidate word nodes having the combinationrelationship with the target response sentence node.

Here, based on the statistics on the logical brain map sample, theconversion probabilities that the parent node is converted to the childnodes are different. Thus, the candidate word node with a highestconversion probability may be selected as the target response word node.In order to ensure the diversity of the dialogues and avoid that thedialogues are limited to one kind of situation, in this embodiment, arandom extraction may be performed on the candidate word nodes accordingto the conversion probabilities of the candidate word nodes, to obtainthe target response word node. In addition, in the range of word nodesexpressing the second semantic encoding, the target response word nodeis extracted layer by layer according to the connection relationshipbetween the word nodes.

For example, it is assumed that the target response sentence node is aparent node, and totally includes 5 layers of word nodes. It is furtherassumed that the target response sentence node has two semanticencodings, one of the semantic encodings matches the second semanticencoding, and the range of word nodes capable of expressing the matchingsemantic encoding is 3 layers of word nodes to which the parent node isconnected. Therefore, the target response sentence node is taken as theparent node, and a first layer of word node to which the parent node isconnected is first extracted. Second, the first layer of word nodeobtained through the extraction is taken as a parent node, a secondlayer of word node is extracted. Finally, the second layer of word nodeobtained through the extraction is taken as a parent node, a third layerof word node is extracted. The three word nodes are used as targetresponse word nodes.

S680, combining the target response word nodes to obtain a targetresponse sentence.

In a specific embodiment of the present disclosure, the target responsesentence refers to a sentence that can express the semantics of thesecond semantic encoding and has a specific external word representationform. The target response sentence may be present in a form of text. Thetarget response sentence is played to the user by the electronic deviceto respond to the user information of the user, thus implementing thedialogue with the user.

In this embodiment, the target word nodes may be combined according tothe connection relationship between the target word nodes, to form thetarget response sentence. For example, in the above example, the firstlayer of word node, the second layer of word node and the third layer ofword node are connected in an order from a parent node to a child node,and combined to form the target response sentence.

According to the technical solution of this embodiment, the semantics ofthe user information is identified through the traversal for the wordnodes in the sentence tree, the response semantics is determined throughthe response relationship between the sentence nodes in the dialoguetree, and finally, the target response sentence is determined throughthe extraction for the word nodes in the sentence tree under theresponse semantics, to be used for the dialogue with the user.

In this embodiment of the present disclosure, the dialogue logic isquickly learned into the sentence tree and the dialogue tree based onthe logical brain map, and the response content takes into account thedialogue content of the preceding part of the dialogue throughalternating matching between the sentence tree and the dialogue tree,and contains various representations of the dialogue content, and thus,the diversity of the dialogue content is ensured, and the accuracy ofthe multi-round dialogue between the user and the machine is improved.

Fourth Embodiment

FIG. 7 is a schematic structural diagram of a dialogue interactionapparatus according to a fourth embodiment of the present disclosure.This embodiment may be applicable to a situation where a responsesentence is determined for a multi-round dialogue between a user and amachine. The apparatus may implement the dialogue interaction methoddescribed in any embodiment of the present disclosure. The apparatus 700specifically includes: a user semantics identifying module 710,configured to determine a first semantic encoding of received userinformation according to a sentence tree; a response semanticsdetermining module 720, configured to determine a second semanticencoding for responding to the user information from a dialogue treeaccording to the first semantic encoding, the sentence tree and thedialogue tree being trained and obtained through sentence nodeinformation and/or word node information in a logical brain map sample;and a response sentence determining module 730, configured to determinea target response sentence of the second semantic encoding from thesentence tree, to be used for a dialogue with a user.

Alternatively, the sentence tree is used to represent a combinationrelationship between a word and a sentence, and the dialogue tree isused to represent a response relationship between sentences in thedialogue.

Further, the apparatus 700 further includes a training module 740,configured to: learn and obtain a node in the sentence tree and a nodein the dialogue tree according to the logical brain map sample; anddetermine, in the sentence tree and the dialogue tree, a conversionprobability between nodes.

Alternatively, the training module 740 is configured to: perform a wordnode depth search on the logical brain map sample to obtain a completedialogue path; constitute a dialogue dictionary according to word nodesin the complete dialogue path; perform sentence semantic compression ona sentence composed of words in the dialogue dictionary to generate asentence node in the sentence tree, and obtain a combination of wordnodes in the sentence node according to the dialogue dictionary; and adda semantic encoding identifying sentence semantics to the sentence nodeaccording to semantics of the combination of the word nodes in thesentence node.

Alternatively, the training module 740 is configured to: performsemantic compression on sentence nodes in the logical brain map sampleto generate a sentence node in the dialogue tree; determine a responserelationship between sentence nodes in the dialogue tree based on adialogue logic represented by a connection relationship between sentencenodes in the logical brain map; and obtain the dialogue tree accordingto the sentence nodes and the response relationship between the sentencenodes, and add semantic encodings identifying sentence semantics to thesentence nodes according to semantics of the sentence nodes.

Alternatively, the user semantics identifying module 710 is configuredto: traverse from a word node to a sentence node in the sentence treeaccording to word information of the user information, and determine acombination of target word nodes constituting the user information; anddetermine, from a sentence node to which the combination of the targetword nodes belongs, the first semantic encoding for representing theuser information, according to the combination of the target word nodes.

Alternatively, the response semantics determining module 720 isconfigured to: position and obtain, from the dialogue tree, a targetuser sentence node consistent with the first semantic encoding; extractand obtain, according to a conversion probability of a candidatesentence node having a response relationship with the target usersentence node, a response sentence node from the candidate sentencenode; and determine the second semantic encoding of the responsesentence node.

Alternatively, the response sentence determining module 730 isconfigured to: find a target response sentence node consistent with thesecond semantic encoding from the sentence tree; extract, according toconversion probabilities of candidate word nodes having a combinationrelationship with the target response sentence node, target responseword nodes from the candidate word nodes; and combine the targetresponse word nodes to obtain the target response sentence.

According to the technical solution of this embodiment, functions suchas the construction for the logical brain map, the training for thesentence tree and the dialogue tree, the identification for the usersemantics, the determination for the response semantics and thedetermination for the response sentence are implemented through thecooperation of the functional modules. In this embodiment of the presentdisclosure, the dialogue logic is quickly learned into the sentence treeand the dialogue tree based on the logical brain map, and the responsecontent takes into account the dialogue content of the preceding part ofthe dialogue through alternating matching between the sentence tree andthe dialogue tree, and contains various representations of the dialoguecontent, and thus, the diversity of the dialogue content is ensured, andthe accuracy of the multi-round dialogue between the user and themachine is improved.

Fifth Embodiment

According to embodiments of the present disclosure, the presentdisclosure further provides an electronic device and a readable storagemedium.

As shown in FIG. 8, FIG. 8 is a block diagram of an electronic devicefor performing a dialogue interaction method according to embodiments ofthe present disclosure. The electronic device is intended to representvarious forms of digital computers such as a laptop computer, a desktopcomputer, a workstation, a personal digital assistant, a server, a bladeserver, a mainframe computer, and other appropriate computers. Theelectronic device may also represent various forms of mobile apparatusessuch as personal digital processing, a cellular telephone, a smartphone, a wearable device and other similar computing apparatuses. Theparts shown herein, their connections and relationships, and theirfunctions are only as examples, and not intended to limitimplementations of the present disclosure as described and/or claimedherein.

As shown in FIG. 8, the electronic device includes one or moreprocessors 801, a storage device 802, and an interface for connectingparts, the interface including a high speed interface and a low speedinterface. The parts are interconnected using different buses, and maybe mounted on a common motherboard or in other ways as needed. Theprocessors may process an instruction executed within the electronicdevice, the instruction including an instruction stored in the storagedevice or on the storage device to display graphical information of agraphical user interface (GUI) on an external input/output apparatussuch as a display device coupled to the interface. In otherimplementations, a plurality of processors and/or a plurality of busesmay be used, if desired, along with a plurality of storage devices.Also, a plurality of electronic devices may be connected, and eachdevice provides a portion of necessary operations (e.g., as a serverarray, a group of blade servers or a multi-processor system). In FIG. 8,one processor 801 is taken as an example.

The storage device 802 is a non-transitory computer readable storagemedium provided in the present disclosure. Here, the storage devicestores an instruction executable by at least one processor, to cause theat least one processor to perform the dialogue interaction methodprovided in the present disclosure. The non-transitory computer readablestorage medium in the present disclosure stores a computer instruction,the computer instruction being used to cause a computer to perform thedialogue interaction method provided in the present disclosure.

As the non-transitory computer readable storage medium, the storagedevice 802 may be used to store a non-transitory software program, anon-transitory computer executable program and a module such as aprogram instruction/module (e.g., the user semantics identifying module710, the response semantics determining module 720, the responsesentence determining module 730 and the training module 740 shown inFIG. 7) corresponding to the dialogue interaction method in embodimentsof the present disclosure. The processor 801 executes various functionalapplications and data processing of the server by running thenon-transitory software program, the instruction and the module storedin the storage device 802, i.e., implements the dialogue interactionmethod in the above embodiments of the method.

The storage device 802 may include a storage program area and a storagedata area. Here, the storage program area may store an operating systemand an application program required for at least one function. Thestorage data area may store data, etc. created according to the use ofthe electronic device of the dialogue interaction method. In addition,the storage device 802 may include a high speed random access memory,and may also include a non-transitory storage device, for example, atleast one magnetic disk storage device, a flash storage device, or othernon-transitory solid state storage devices. In some embodiments, thestorage device 802 may alternatively include a storage device disposedremotely relative to the processor 801. The remote storage device may beconnected to the electronic device of the dialogue interaction methodvia a network. Examples of such network include, but not limited to, theInternet, an enterprise intranet, a local area network, a mobilecommunication network, and a combination thereof.

The electronic device of the dialogue interaction method may furtherinclude: an input apparatus 803 and an output apparatus 804. Theprocessor 801, the storage device 802, the input apparatus 803 and theoutput apparatus 804 may be connected via a bus or in other ways. InFIG. 8, the connection via a bus is taken as an example.

The input apparatus 803 may receive an inputted number or inputtedcharacter information, and generate a key signal input related to theuser setting and functional control of the electronic device of thedialogue interaction method. For example, the input apparatus is a touchscreen, a keypad, a mouse, a track pad, a touch pad, a pointing stick,one or more mouse buttons, a track ball, a joystick, or the like. Theoutput apparatus 804 may include a display device, an auxiliary lightingapparatus (e.g., a light emitting diode (LED)), a tactile feedbackapparatus (e.g., a vibration motor), etc. The display device mayinclude, but not limited to, a liquid crystal display (LCD), an LEDdisplay, and a plasma display. In some embodiments, the display devicemay be a touch screen.

Various implementations of the systems and techniques described hereinmay be implemented in a digital electronic circuit system, an integratedcircuit system, an application specific integrated circuit (ASIC),computer hardware, firmware, software, and/or combinations thereof.These various implementations may include the implementation in one ormore computer programs. The one or more computer programs may beexecuted and/or interpreted on a programmable system including at leastone programmable processor, and the programmable processor may be adedicated or general-purpose programmable processor, may receive dataand instructions from a storage system, at least one input apparatus andat least one output apparatus, and transmit the data and theinstructions to the storage system, the at least one input apparatus andthe at least one output apparatus.

These computing programs, also referred to as programs, software,software applications or codes, include a machine instruction of theprogrammable processor, and may be implemented using a high-levelprocedural and/or an object-oriented programming language, and/or anassembly/machine language. As used herein, the terms “machine readablemedium” and “computer readable medium” refer to any computer programproduct, device and/or apparatus (e.g., a magnetic disk, an opticaldisk, a storage device and a programmable logic device (PLD)) used toprovide a machine instruction and/or data to the programmable processor,and include a machine readable medium that receives the machineinstruction as a machine readable signal. The term “machine readablesignal” refers to any signal used to provide the machine instructionand/or data to the programmable processor.

To provide an interaction with a user, the systems and techniquesdescribed here may be implemented on a computer having a displayapparatus (e.g., a cathode ray tube (CRT)) or an LCD monitor) fordisplaying information to the user, and a keyboard and a pointingapparatus (e.g., a mouse or a track ball) by which the user may providethe input to the computer. Other kinds of apparatuses may also be usedto provide the interaction with the user. For example, a feedbackprovided to the user may be any form of sensory feedback (e.g., a visualfeedback, an auditory feedback, or a tactile feedback); and an inputfrom the user may be received in any form, including acoustic, speech,or tactile input.

The systems and techniques described here may be implemented in acomputing system (e.g., a data server) that includes a backend part,implemented in a computing system (e.g., an application server) thatincludes a middleware part, implemented in a computing system (e.g., auser computer having a graphical user interface or a Web browser throughwhich the user may interact with an implementation of the systems andtechniques described here) that includes a frontend part, or implementedin a computing system that includes any combination of the backend part,the middleware part or the frontend part. The parts of the system may beinterconnected by any form or medium of digital data communication(e.g., a communication network). Examples of the communication networkinclude a local area network (LAN), a wide area network (WAN) and theInternet.

The computer system may include a client and a server. The client andthe server are generally remote from each other and typically interactthrough the communication network. The relationship between the clientand the server is generated through computer programs running on therespective computer and having a client-server relationship to eachother.

According to the technical solution of embodiments of the presentdisclosure, a dialogue logic is quickly learned into a sentence tree anda dialogue tree based on a logical brain map, and response content takesinto account the dialogue content of a preceding part of a dialoguethrough alternating matching between the sentence tree and the dialoguetree, and contains various representations of the dialogue content, andthus, the diversity of the dialogue content is ensured, and the accuracyof a multi-round dialogue between a user and a machine is improved.

In addition, through a sentence tree having a combination relationshipand a dialogue tree having a response relationship, the response contenttakes into account the dialogue content of the preceding part of thedialogue, and contains the various representations of the dialoguecontent, and thus, various possibilities of the dialogue content areensured.

In addition, node information and a conversion probability between nodesthat are determined according to a logical brain map sample togetherconstitute the sentence tree and the dialogue tree, such that the nodesin the trees have a dialogue logic, and the various representations ofthe dialogue content are contained, and thus, the various possibilitiesof the dialogue content are ensured.

In addition, a word in a dialogue dictionary constructed based on thelogical brain map sample constitutes a word node in the sentence tree,and semantics expressed by a combination of word nodes constitutes asentence node. Based on different approaches to combine the word nodes,the sentence node may contain different sentence semantics, and thus,each kind of sentence semantics is configured with a correspondingsemantic encoding, which is conductive to identifying user informationof different representations and conductive to a plurality ofrepresentations of the same semantics, thereby ensuring the diversity ofdialogues.

In addition, sentence semantics compressed based on the logical brainmap sample constitutes a sentence node in the dialogue tree, and asemantic encoding is added to each sentence node. A responserelationship between sentence nodes in the dialogue tree is determinedbased on the dialogue logic in the logical brain map, and thecorresponding relationship of the semantics is conductive to determiningthe dialogue logic between utterances in the dialogue, and is notlimited to the representation of a word in a sentence.

In addition, by matching the word information in the user informationand the sentence node in the sentence tree, a combination of target wordnodes conforming to the word information is determined, such that thefirst semantic encoding of the sentence node to which the combination ofthe target word nodes belongs is determined, thereby implementing thesemantic identification for the user information.

In addition, based on the first semantic encoding, a sentence node ispositioned in the dialogue tree, such that the second semantic encodingresponding to the user information is determined according to a responserelationship between sentence nodes. Therefore, it is implemented thatthe response semantics is determined on the basis of the dialogue logic,and the limitation of the word representation on the dialogue and theneglect of the preceding part of the dialogue are avoided, thus ensuringthe diversity and accuracy of dialogues.

In addition, a target response sentence node is determined from thesentence tree according to the second semantic encoding as the responsesemantics, a combination of words expressing the second semantics isdetermined according to the second semantic encoding, and finally, atarget response sentence is formed to be used for the dialogue. In thesituation where the semantics is correctly expressed, the diversity ofdialogues is ensured.

It should be understood that the various forms of processes shown abovemaybe used to resort, add or delete steps.

For example, the steps described in the present disclosure may beperformed in parallel, sequentially, or in a different order. As long asthe desired result of the technical solution disclosed in the presentdisclosure can be achieved, no limitation is made herein.

The above embodiments do not constitute a limitation to the scope ofprotection of the present disclosure. It should be appreciated by thoseskilled in the art that various modifications, combinations,sub-combinations and substitutions may be made depending on designrequirements and other factors. Any modifications, equivalents andreplacements, and improvements falling within the spirit and theprinciple of the present disclosure should be included within the scopeof protection of the present disclosure.

What is claimed is:
 1. A dialogue interaction method, comprising:determining a first semantic encoding of received user informationaccording to a sentence tree; determining a second semantic encoding forresponding to the user information from a dialogue tree according to thefirst semantic encoding, the sentence tree and the dialogue tree beingtrained and obtained through sentence node information and/or word nodeinformation in a logical brain map sample; and determining a targetresponse sentence of the second semantic encoding from the sentencetree, to be used for a dialogue with a user.
 2. The method according toclaim 1, wherein the sentence tree is used to represent a combinationrelationship between a word and a sentence, and the dialogue tree isused to represent a response relationship between sentences in thedialogue.
 3. The method according to claim 1, wherein the sentence treeand the dialogue tree are determined by: learning and obtaining a nodein the sentence tree and a node in the dialogue tree according to thelogical brain map sample; and determining, in the sentence tree and thedialogue tree, a conversion probability between nodes.
 4. The methodaccording to claim 3, wherein learning and obtaining the node in thesentence tree according to the logical brain map sample comprises:performing a word node depth search on the logical brain map sample toobtain a complete dialogue path; constituting a dialogue dictionaryaccording to word nodes in the complete dialogue path; performingsentence semantic compression on a sentence composed of words in thedialogue dictionary to generate a sentence node in the sentence tree,and obtaining a combination of word nodes in the sentence node accordingto the dialogue dictionary; and adding a semantic encoding identifyingsentence semantics to the sentence node according to semantics of thecombination of the word nodes in the sentence node.
 5. The methodaccording to claim 3, wherein learning and obtaining the node in thedialogue tree according to the logical brain map sample comprises:performing semantic compression on sentence nodes in the logical brainmap sample to generate a sentence node in the dialogue tree; determininga response relationship between sentence nodes in the dialogue treebased on a dialogue logic represented by a connection relationshipbetween sentence nodes in the logical brain map; and obtaining thedialogue tree according to the sentence nodes and the responserelationship between the sentence nodes, and adding a semantic encodingidentifying sentence semantics to the sentence nodes according tosemantics of the sentence nodes.
 6. The method according to claim 1,wherein the determining a first semantic encoding of received userinformation according to a sentence tree comprises: traversing from aword node to a sentence node in the sentence tree according to wordinformation of the user information, and determining a combination oftarget word nodes constituting the user information; and determining,from a sentence node to which the combination of the target word nodesbelongs, the first semantic encoding for representing the userinformation, according to the combination of the target word nodes. 7.The method according to claim 1, wherein the determining a secondsemantic encoding for responding to the user information from a dialoguetree according to the first semantic encoding comprises: positioning andobtaining, from the dialogue tree, a target user sentence nodeconsistent with the first semantic encoding; extracting and obtaining,according to a conversion probability of a candidate sentence nodehaving a response relationship with the target user sentence node, aresponse sentence node from the candidate sentence node; and determiningthe second semantic encoding of the response sentence node.
 8. Themethod according to claim 1, wherein the determining a target responsesentence of the second semantic encoding from the sentence treecomprises: finding a target response sentence node consistent with thesecond semantic encoding from the sentence tree; extracting, accordingto conversion probabilities of candidate word nodes having a combinationrelationship with the target response sentence node, target responseword nodes from the candidate word nodes; and combining the targetresponse word nodes to obtain the target response sentence.
 9. Anelectronic device, comprising: at least one processor; and a storagedevice, communicatively connected with the at least one processor,wherein the storage device stores an instruction executable by the atleast one processor, and the instruction is executed by the at least oneprocessor, to cause the at least one processor to perform operations,the operations comprising: determining a first semantic encoding ofreceived user information according to a sentence tree; determining asecond semantic encoding for responding to the user information from adialogue tree according to the first semantic encoding, the sentencetree and the dialogue tree being trained and obtained through sentencenode information and/or word node information in a logical brain mapsample; and determining a target response sentence of the secondsemantic encoding from the sentence tree, to be used for a dialogue witha user.
 10. The electronic device according to claim 9, wherein thesentence tree is used to represent a combination relationship between aword and a sentence, and the dialogue tree is used to represent aresponse relationship between sentences in the dialogue.
 11. Theelectronic device according to claim 9, wherein the sentence tree andthe dialogue tree are determined by: learning and obtaining a node inthe sentence tree and a node in the dialogue tree according to thelogical brain map sample; and determining, in the sentence tree and thedialogue tree, a conversion probability between nodes.
 12. Theelectronic device according to claim 11, wherein learning and obtainingthe node in the sentence tree according to the logical brain map samplecomprises: performing a word node depth search on the logical brain mapsample to obtain a complete dialogue path; constituting a dialoguedictionary according to word nodes in the complete dialogue path;performing sentence semantic compression on a sentence composed of wordsin the dialogue dictionary to generate a sentence node in the sentencetree, and obtaining a combination of word nodes in the sentence nodeaccording to the dialogue dictionary; and adding a semantic encodingidentifying sentence semantics to the sentence node according tosemantics of the combination of the word nodes in the sentence node. 13.The electronic device according to claim 11, wherein learning andobtaining the node in the dialogue tree according to the logical brainmap sample comprises: performing semantic compression on sentence nodesin the logical brain map sample to generate a sentence node in thedialogue tree; determining a response relationship between sentencenodes in the dialogue tree based on a dialogue logic represented by aconnection relationship between sentence nodes in the logical brain map;and obtaining the dialogue tree according to the sentence nodes and theresponse relationship between the sentence nodes, and adding a semanticencoding identifying sentence semantics to the sentence nodes accordingto semantics of the sentence nodes.
 14. The electronic device accordingto claim 9, wherein the determining a first semantic encoding ofreceived user information according to a sentence tree comprises:traversing from a word node to a sentence node in the sentence treeaccording to word information of the user information, and determining acombination of target word nodes constituting the user information; anddetermining, from a sentence node to which the combination of the targetword nodes belongs, the first semantic encoding for representing theuser information, according to the combination of the target word nodes.15. The electronic device according to claim 9, wherein the determininga second semantic encoding for responding to the user information from adialogue tree according to the first semantic encoding comprises:positioning and obtaining, from the dialogue tree, a target usersentence node consistent with the first semantic encoding; extractingand obtaining, according to a conversion probability of a candidatesentence node having a response relationship with the target usersentence node, a response sentence node from the candidate sentencenode; and determining the second semantic encoding of the responsesentence node.
 16. The electronic device according to claim 9, whereinthe determining a target response sentence of the second semanticencoding from the sentence tree comprises: finding a target responsesentence node consistent with the second semantic encoding from thesentence tree; extracting, according to conversion probabilities ofcandidate word nodes having a combination relationship with the targetresponse sentence node, target response word nodes from the candidateword nodes; and combining the target response word nodes to obtain thetarget response sentence.
 17. A non-transitory computer readable storagemedium, storing a computer instruction, wherein the computer instructionis used to cause a computer to perform operations, the operationscomprising: determining a first semantic encoding of received userinformation according to a sentence tree; determining a second semanticencoding for responding to the user information from a dialogue treeaccording to the first semantic encoding, the sentence tree and thedialogue tree being trained and obtained through sentence nodeinformation and/or word node information in a logical brain map sample;and determining a target response sentence of the second semanticencoding from the sentence tree, to be used for a dialogue with a user.